<?php

namespace App\Http\Controllers;

use App\AdminPermission;
use Illuminate\Http\Request;

class AdminPermissionController extends Controller
{
    //
    public function plist()
    {
        $adminPermissions= AdminPermission::paginate(5);
        return view("admin.permission.list",compact("adminPermissions"));

    }
    public function add()
    {

        return view("admin.permission.add");

    }
    public function store(Request $request)
    {
        $adminPermission = new AdminPermission();
        $adminPermission->name = $request->name;
        $adminPermission->desc = $request->desc;
        $adminPermission->save();
        return[
            "error"=>0,
            "info"=>"添加成功",
        ];
    }
}
